package com.ruoyi.hospital.domain;



import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Dept extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 岗位序号 */
    @Excel(name = "岗位序号", cellType = Excel.ColumnType.NUMERIC)
    private Long id;

    /** 岗位名字 */
    @Excel(name = "岗位名字")
    private String department;

    /** 院区 */
    @Excel(name = "院区")
    private String courtyard;


    /** 地址 */
    @Excel(name = "地址")
    private String addr;




    @Excel(name = "时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date = new Date();

    /** 父级 */
    @Excel(name = "上级科室Id")
    private Long parentId;

    //无限极数
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Dept> children = new ArrayList<>();

    //部门的上级
    private Dept parent;//上级部门

    public Dept() {
    }

    public Dept(Long id, String department, String courtyard, String addr, Date date, Long parentId, List<Dept> children, Dept parent) {
        this.id = id;
        this.department = department;
        this.courtyard = courtyard;
        this.addr = addr;
        this.date = date;
        this.parentId = parentId;
        this.children = children;
        this.parent = parent;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getCourtyard() {
        return courtyard;
    }

    public void setCourtyard(String courtyard) {
        this.courtyard = courtyard;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public List<Dept> getChildren() {
        return children;
    }

    public void setChildren(List<Dept> children) {
        this.children = children;
    }

    public Dept getParent() {
        return parent;
    }

    public void setParent(Dept parent) {
        this.parent = parent;
    }

    @Override
    public String toString() {
        return "Dept{" +
                "id=" + id +
                ", department='" + department + '\'' +
                ", courtyard='" + courtyard + '\'' +
                ", addr='" + addr + '\'' +
                ", date=" + date +
                ", parentId=" + parentId +
                ", children=" + children +
                ", parent=" + parent +
                '}';
    }
}

